﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmProfesion.aspx.cs" Inherits="ddcCajamarca.Web.Directorio.frmProfesion" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div class="row">
        <div class="col-sm-6">
            <asp:FormView ID="fvProfesion" runat="server" Width="100%"
                DefaultMode="Edit"
                SelectMethod="GetProfesion"
                UpdateMethod="UpdateProfesion"
                InsertMethod="InsertProfesion"
                ItemType="ddcCajamarca.BusinessEntities.Directorio.Profesion">
                <InsertItemTemplate>
                    <div>
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                Registrar Profesión
                            </div>
                            <div class="panel-body">
                               
                                <div class="form-group">
                                    <label>Nombre:</label>
                                    <asp:TextBox ID="txtDescripcion" Text="<%# BindItem.Descripcion %>" 
                                        CssClass="form-control input-sm" runat="server" MaxLength="200"/>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtDescripcion" 
                                        ErrorMessage="* Campo necesario" ForeColor="Red"></asp:RequiredFieldValidator>
                                </div>
                                <div class="form-group">
                                    <label>Abreviatura:</label>
                                    <asp:TextBox ID="txtAbreviatura" Text="<%# BindItem.Abreviatura %>" 
                                        CssClass="form-control input-sm" runat="server" MaxLenght="15"/>
                                </div>
                            </div>
                            <div class="panel-footer">
                                <asp:Button ID="btnGuardar" CommandName="insert" CssClass="btn btn-success" Text="Guardar" runat="server"/>
                                <a href="frmListProfesion.aspx" class="btn btn-danger" style="color:#ffffff;"> Cancelar</a>
                            </div>
                        </div>
                        <div class="bg-danger">
                            <asp:ValidationSummary ID="vsInsert" runat="server" ShowModelStateErrors="True"/>
                            </div>
                    </div>
                </InsertItemTemplate>
                <EditItemTemplate>
                    <div>
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                Actualizar Informacion de Profesión
                            </div>
                            <div class="panel-body">
                                <div class="form-group">
                                    <label>Id:</label>
                                    <asp:TextBox ID="txtId" Text="<%# BindItem.Id %>" 
                                        CssClass="form-control input-sm" Enabled="False" runat="server"/>
                                </div>
                                <div class="form-group">
                                    <label>Nombre:</label>
                                    <asp:TextBox ID="txtDescripcion" Text="<%# BindItem.Descripcion %>" 
                                        CssClass="form-control input-sm" runat="server" MaxLength="200"/>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtDescripcion" 
                                        ErrorMessage="* Campo necesario" ForeColor="Red"></asp:RequiredFieldValidator>
                                </div>
                                <div class="form-group">
                                    <label>Abreviatura:</label>
                                    <asp:TextBox ID="txtAbreviatura" Text="<%# BindItem.Abreviatura %>" 
                                        CssClass="form-control input-sm" runat="server" MaxLenght="15"/>
                                </div>
                            </div>
                            <div class="panel-footer">
                                <asp:Button ID="btnGuardar" CommandName="update" CssClass="btn btn-success" Text="Guardar" runat="server"/>
                                <a href="frmListProfesion.aspx" class="btn btn-danger" style="color:#ffffff;"> Cancelar</a>
                            </div>
                        </div>
                        <div class="bg-danger">
                                <asp:ValidationSummary ID="vsInsert" runat="server" 
                            ShowModelStateErrors="True"/>
                            </div>
                    </div>
                </EditItemTemplate>
            </asp:FormView>
        </div>
    </div>
</asp:Content>
